home *** CD-ROM | disk | FTP | other *** search
/ Garden Companion (Special Edition) / Garden Companion Special Edition.iso / VFW / SETUP.MST < prev    next >
Text File  |  1995-10-20  |  11KB  |  319 lines

  1. '**************************************************************************
  2. '*          Indeo(R) video interactive and VfW 1.1e Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST LICENSE       = 101
  11. CONST ASKQUIT       = 200
  12. CONST EXITFAILURE   = 400
  13. CONST EXITQUIT      = 600
  14. CONST EXITSUCCESS   = 700
  15. CONST APPHELP       = 900
  16. CONST CHECK         = 2500
  17. CONST SMALLWIN      = 2200
  18. CONST RESTART       = 2600
  19. CONST RESTARTII     = 2700
  20.  
  21. ''Bitmap ID
  22. CONST LOGO = 1
  23.  
  24. GLOBAL SizeReq&  '' Total Disk Size required for installation
  25.  
  26. ''File Types
  27. GLOBAL WinDir$
  28. GLOBAL WinSysDir$
  29. GLOBAL WinSys32Dir$
  30. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  31. GLOBAL CHECKSTATES$
  32. GLOBAL MinorVer%
  33. GLOBAL OnNT$
  34.  
  35. DECLARE SUB Install
  36. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  37. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  38. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  39. DECLARE SUB Reboot LIB "iniupd.dll"
  40. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  41.  
  42. INIT:
  43.   
  44.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  45.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  46.     
  47.     WIN32ENABLED% = 0
  48.     MajorVer% = GetWindowsMajorVersion()
  49.     MinorVer% = GetWindowsMinorVersion()
  50.     Processor% = GetProcessorType()
  51.     WinDir$ = GetWindowsDir()
  52.     DEST$ = GetWindowsDir()
  53.     WinSysDir$ = GetWindowsSysDir()
  54.     WinSys32Dir$ = WinDir$ + "system32"
  55.  
  56.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  57.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  58.     END
  59.     END IF
  60.  
  61.     'Prevents installation on 286
  62.     IF Processor% < 3 THEN
  63.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  64.     END
  65.     END IF
  66.  
  67.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  68.     IF OnWindowsNT() THEN
  69.       OnNT$ = "TRUE"
  70.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  71.       IF WowVersion$ = "" THEN
  72.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  73.          END
  74.       END IF
  75.     END IF
  76.  
  77.     SetBitmap CUIDLL$, LOGO
  78.     SetTitle "Indeo« video interactive and VfW 1.1e"
  79.  
  80.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  81.     IF szInf$ = "" THEN
  82.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  83.     END IF
  84.     ReadInfFile szInf$
  85.  
  86.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  87.  
  88. WELCOME:
  89.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  90.     IF sz$ = "CONTINUE" THEN
  91.        UIPop 1
  92.      ELSE
  93.        GOSUB ASKQUIT
  94.        GOTO WELCOME
  95.     END IF
  96.  
  97. LICENSE:
  98.     sz$ = UIStartDlg(CUIDLL$, LICENSE, "FInfoDlgProc", APPHELP, HELPPROC$)
  99.     IF sz$ = "CONTINUE" THEN
  100.        UIPop 1
  101.     ELSEIF sz$ = "BACK" THEN
  102.        UIPop 1
  103.        SrcDir$ = GetSymbolValue("STF_SRCDIR")
  104.        Run ("NOTEPAD " + MakePath(SrcDir$, "LICENSE.TXT"))
  105.        GOTO LICENSE
  106.     ELSE
  107.        UIPop 1
  108.        GOSUB ASKQUIT
  109.        GOTO LICENSE
  110.     END IF
  111.  
  112. ''Prepare Copy list and check size
  113.  
  114.     ClearCopyList
  115.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  116.  
  117. '' Remove DCISVGA file
  118.     AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
  119.  
  120. ''  Runtime files (on Windows disk)
  121. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  122.  
  123.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN            'These files not necessary on Windows NT
  124.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  125.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  126.     END IF
  127.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  128.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  129.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  130.     IF OnNT$ = "TRUE" THEN
  131.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  132.     ENDIF
  133. ''*************************************************************************************************************************
  134. ''*************************************************************************************************************************
  135. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  136. ''and add a "DCI Provider" section with to the SETUP.INF file.
  137. ''
  138. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  139. ''*************************************************************************************************************************
  140. ''*************************************************************************************************************************
  141.  
  142. ''  Check windrive diskspace
  143.     SizeReq& = GetCopyListCost ("","", "")
  144.     IF SizeReq& <> 0 THEN
  145.     GOSUB SMALLWIN
  146.     END
  147.     END IF
  148.  
  149. Install
  150.  
  151. README:
  152.     IF DoMsgBox("Would you like to read the Indeo video README file now?", "Indeo« video README", 4) = 6 THEN
  153.        SrcDir$ = GetSymbolValue("STF_SRCDIR")
  154.        Run ("NOTEPAD " + MakePath(SrcDir$, "README16.TXT"))
  155.     ENDIF
  156.  
  157. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  158. '' else, it gives the user the choice
  159.     RESTRT% = RestartListEmpty ()
  160.     Exe$ = DEST$ + "\_msrstrt.exe"
  161.     Batch$ = DEST$ + "\_mssetup.bat"
  162.     empty$ = ""
  163. RESTART:
  164.     IF RESTRT% = 0 THEN
  165.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  166.        IF sz$ = "REACTIVATE" THEN
  167.       GOTO RESTART
  168.        ENDIF
  169.        I% = ExitExecRestart ()
  170.        RemoveFile Exe$, cmoForce
  171.        RemoveFile Batch$, cmoForce
  172.        END
  173.     ELSE
  174.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  175.        IF sz$ = "CONTINUE" THEN
  176.       I% = ExitWindowsExec (Exe$, empty$)
  177.       IF I% = 0 THEN
  178.          GOTO RESTART
  179.       ELSE
  180.          END
  181.      ENDIF
  182.        ELSEIF sz$ = "EXIT" THEN
  183.       UIPopAll
  184.       END
  185.        ELSEIF sz$ = "REACTIVATE" THEN
  186.       GOTO RESTART
  187.        ELSE
  188.       UIPop 1
  189.        END IF
  190.     END IF
  191.  
  192.  
  193. QUIT:
  194.     ON ERROR GOTO ERRQUIT
  195.  
  196.     IF ERR = 0 THEN
  197.     dlg% = EXITSUCCESS
  198.     ELSEIF ERR = STFQUIT THEN
  199.     dlg% = EXITQUIT
  200.     ELSE
  201.     dlg% = EXITFAILURE
  202.     END IF
  203. QUITL1:
  204.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  205.     IF sz$ = "REACTIVATE" THEN
  206.     GOTO QUITL1
  207.     END IF
  208.     UIPop 1
  209.     END
  210.  
  211. ERRQUIT:
  212.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  213.     END
  214.  
  215.  
  216. ASKQUIT:
  217.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  218.  
  219.     IF sz$ = "EXIT" THEN
  220.     UIPopAll
  221. ''        ERROR STFQUIT
  222.     END
  223.     ELSEIF sz$ = "REACTIVATE" THEN
  224.     GOTO ASKQUIT
  225.     ELSE
  226.     UIPop 1
  227.     END IF
  228.     RETURN
  229.  
  230. SMALLWIN:
  231.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  232.     IF sz$ = "REACTIVATE" THEN
  233.     GOTO SMALLWIN
  234.     END IF
  235.     UIPop 1
  236.     RETURN
  237.  
  238. '**
  239. '** Purpose:
  240. '**     Performs all installation operations.
  241. '** Arguments:
  242. '**     none.
  243. '** Returns:
  244. '**     none.
  245. '*************************************************************************
  246. SUB Install STATIC
  247.  
  248.     SetRestartDir WinDir$
  249.     CopyFilesInCopyList
  250.  
  251. ''Updating WIN.INI and SYSTEM.INI
  252. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  253.  
  254. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  255.     IF VflatdPresent() = 0 THEN
  256.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  257.     END IF
  258. END IF
  259.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV41", "ir41.dll", cmoOverwrite
  260.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  261.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  262.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  263.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  264.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  265.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  266.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  267.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  268.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  269.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  270.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  271.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  272.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  273.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  274.  
  275. ''*************************************************************************************************************************
  276. ''*************************************************************************************************************************
  277. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the    <provider> with your own file name
  278. ''
  279. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  280. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  281. ''*************************************************************************************************************************
  282. ''*************************************************************************************************************************
  283.  
  284. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  285. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  286.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  287.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  288.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  289.  
  290. '' Mplayer
  291.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  292.  
  293. END IF    ''NT and next version of Windows installation stop here.
  294.  
  295.     Run ("profdisp.exe")   
  296. END SUB
  297.  
  298. '**
  299. '** Purpose:
  300. '**     Appends a file name to the end of a directory path,
  301. '**     inserting a backslash character as needed.
  302. '** Arguments:
  303. '**     szDir$  - full directory path (with optional ending "\")
  304. '**     szFile$ - filename to append to directory
  305. '** Returns:
  306. '**     Resulting fully qualified path name.
  307. '*************************************************************************
  308. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  309.     IF szDir$ = "" THEN
  310.     MakePath = szFile$
  311.     ELSEIF szFile$ = "" THEN
  312.     MakePath = szDir$
  313.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  314.     MakePath = szDir$ + szFile$
  315.     ELSE
  316.     MakePath = szDir$ + "\" + szFile$
  317.     END IF
  318. END FUNCTION
  319.